#!/usr/bin/python
#-*-coding:utf-8-*-

import sys, time
from lib import *
from lib.pressureFunc import *

if __name__ == '__main__':
    cpu = {}
    cpu["data"] = DataCenter()
    startNum = 0
    endNum = 0
    if sys.argv[1]:
        startNum = int(sys.argv[1])
    if sys.argv[2]:
        endNum = int(sys.argv[2])
    if len(sys.argv) == 4:
        voiceLength = int(sys.argv[3])
    else:
        voiceLength = 60
    cpu["data"].voiceLength = voiceLength

    for i in range(startNum, endNum+1):
        num = i
        log.info("Start to sendVoice from num: "+str(num))
        thread_sendRtpData = threading.Thread(target=sendRtpData, args=(cpu,num,))
        thread_sendRtpData.start()
        log.info("end to excute the function of PT_getOnlineNumMax...")
        time.sleep(0.02)
